//
//  BanBu_Tile.m
//  BanBu
//
//  Created by laiguo zheng on 12-7-10.
//  Copyright (c) 2012年 17xy. All rights reserved.
//

#import "BanBu_Tile.h"

#define titleLabelHeight 15
#define boyColor [UIColor colorWithRed:48.0/255 green:169.0/255 blue:217.0/255 alpha:1.0]
#define girlColor [UIColor colorWithRed:252.0/255 green:192.0/255 blue:213.0/255 alpha:1.0]

@implementation BanBu_Tile

@synthesize distanceLabel = _distanceLabel;
@synthesize sex = _sex;
@synthesize imageShow = _imageShow;
@synthesize vipImageView = _vipImageView;
@synthesize sexImgV = _sexImgV;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor clearColor];
        
        _imageShow = [[UIImageView alloc] initWithFrame:self.bounds];
        [self addSubview:_imageShow];
        
        _distanceLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-titleLabelHeight, self.bounds.size.width, titleLabelHeight)];
        _distanceLabel.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
        _distanceLabel.font = [UIFont systemFontOfSize:13];
        _distanceLabel.textColor = [UIColor whiteColor];
        _distanceLabel.textAlignment = kTextAlignmentLeft;
        [self addSubview:_distanceLabel];
        [_distanceLabel release];
        
        _vipImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 18, 18)];
        NSString *vippath = [[NSBundle mainBundle] pathForResource:@"vipFlag" ofType:@"png"];

        _vipImageView.image = [UIImage imageWithContentsOfFile:vippath];
        _vipImageView.hidden = YES;
        [self addSubview:_vipImageView];
        [_vipImageView release];
        
        _sexImgV = [[UIImageView alloc]initWithFrame:CGRectMake(60, 61, 13, 13)];
        [self addSubview:_sexImgV];
        [_sexImgV release];
        
    }
    return self;
}

- (void)setSex:(NSString *)sex
{

    NSString *sexpath = [[NSBundle mainBundle] pathForResource:sex ofType:@"png"];
    _sexImgV.image = [UIImage imageWithContentsOfFile:sexpath];
}


- (void)dealloc
{
    _imageShow = nil;
    _sex = nil;
    _sexImgV = nil;
    _distanceLabel = nil;
    [super dealloc];
}

@end
 

